package com.xinqi.modules.sys.user.controller.app;

import com.xinqi.common.base.response.R;
import com.xinqi.common.satoken.utils.LoginHelper;
import com.xinqi.modules.user.user.client.UserClient;
import com.xinqi.modules.user.user.dto.rsp.UserResultDTO;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "Web-用户信息", description = "用户信息Web接口-临时使用")
@RestController
@RequestMapping("/web/user")
@RequiredArgsConstructor
public class UserAppController {

    private final UserClient userClient;

    /**
     * 获取登录人的用户信息
     *
     * @return
     */
    @GetMapping("/getInfo")
    public R<UserResultDTO> getInfo() {
        return userClient.getInfo(LoginHelper.getUserId());
    }

}
